import React, { useReducer } from 'react'
import RouterPage from './router'
import getGlobalReducer from './utils/getGlobalReducer'
import getGlobalContext from './utils/getGlobalContext'

export default function App() {
  const [state, dispatch] = useReducer(getGlobalReducer.reducer, getGlobalReducer.initState)

  return (
    <getGlobalContext.Provider value={{
      state,
      dispatch
    }}>
      <div className="APP">
        <RouterPage></RouterPage>
      </div>
    </getGlobalContext.Provider>
  )
}
